#!/usr/bin/perl

use CGI;
$query = CGI::new();
print $query->header();

$v = $query->param("v");

print STDERR "v=$v\n";

$id = $v;
$id =~ s|.*/||;

print STDERR "id=$id\n";

$f = "im/$id";

if (! -e $f) {
    system("curl --silent --show-error $v > $f");
}

print "$f\n";
